#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    srand(time(0));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_accept_clicked()
{
    ui->label->setText("女神女神，快来嘴儿一个~，mua~");
}

void Widget::on_pushButton_reject_clicked()
{
    // 如果女神点击了这个按钮，就把这个按钮挪走
    // 通过生成随机数，确定位置

    // 获取当前程序窗口尺寸
    int width = this->geometry().width();
    int height = this->geometry().height();

    // 生成当前位置
    int x = rand() % width;
    int y = rand() % height;

    ui->pushButton_reject->move(x, y);
}

void Widget::on_pushButton_reject_pressed()
{
    int width = this->geometry().width();
    int height = this->geometry().height();

    // 生成当前位置
    int x = rand() % width;
    int y = rand() % height;

    ui->pushButton_reject->move(x, y);
}
